# compiler 
CC = gcc
# GLEWROOTDIR = /home/ldbrown/glew
GLEWROOTDIR=./glew

# libraries we're linking against
LIBALIASES = -lGL -lGLU -lGLEW -lglut -lm -ljpeg

APPNAME = hw5

APPCODE = \
hw5.cxx \
mobile.cxx \
bump.cxx \
raster.cxx \
raster-jpeg.cxx \

APPOBJS = $(APPCODE:.cxx=.o)

INCLUDES = -I$(GLEWROOTDIR)/include

LIBPATHS = -L$(GLEWROOTDIR)/lib

# silent running
.SILENT:

# make cxx into objects
%.o: %.cxx
	echo Compiling $< 
	$(CC) $(INCLUDES) -c $<

################################
# build rules

all:
	echo
	make $(APPNAME)

# create program
$(APPNAME): $(APPOBJS)
	echo
	echo Building $(APPNAME) 
	$(CC) -o $(APPNAME) $(APPOBJS) $(LIBPATHS) $(LIBALIASES)
	echo Building Complete.

################################
# start a fresh build

tarball:
	tar -czf hw5.tar.gz *.h *.cxx *.glsl pics/*.jpg glew/ Makefile README TODO

clean:
	rm -f *.o $(APPNAME)
	echo Cleaned.
